//- Copyright (c) 2016 Lucky Byte, Inc.
extends ../layout

append scripts
  script(src="/js/p2/body.js")

block content
  form.ui.form.attached.segment.main(method="post" action="/p2/check")
    input(type="hidden" name="check_action" value="#{record.action}")

    - var action = ''
    - var color  = ''
    case record.action
      when 1
        - action = '新增'
        - color = 'green'
      when 2
        - action = '修改'
        - color = 'blue'
      when 3
        - action = '删除'
        - color = 'red'
        
    .ui.large.label.right.ribbon.nolayout(class="#{color}")
      | 用户 '#{record.input_user}' 于 
      | #{record.input_time.format('YYYY-MM-DD HH:mm:ss')}
      | #{action} 了此配置，请复核...

    include body

    .ui.buttons(style="margin-top:40px;")
      button.ui.yellow.button#cancel(type="button"
        onclick="window.location = '/p2'") 取 消

      .or

      if page_perms.check
        button.ui.green.button#ok(type="submit") 通 过
      else
        button.ui.green.button.disabled#ok(type="submit")
          i.icon.ban(style="margin-top:1px; margin-right:2px;")
          | 通 过
